home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / u_man / cat1 / perlmodlib.z / perlmodlib
Encoding:
Text File  |  1998-10-30  |  41.5 KB  |  1,189 lines

  1.  
  2.  
  3.  
  4. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      perlmodlib - constructing new Perl modules and finding existing ones
  10.  
  11. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  12. TTTTHHHHEEEE PPPPEEEERRRRLLLL MMMMOOOODDDDUUUULLLLEEEE LLLLIIIIBBBBRRRRAAAARRRRYYYY
  13.      A number of modules are included the Perl distribution.  These are
  14.      described below, and all end in ._p_m.  You may also discover files in the
  15.      library directory that end in either ._p_l or ._p_h.  These are old libraries
  16.      supplied so that old programs that use them still run.  The ._p_l files
  17.      will all eventually be converted into standard modules, and the ._p_h files
  18.      made by hhhh2222pppphhhh will probably end up as extension modules made by hhhh2222xxxxssss.
  19.      (Some ._p_h values may already be available through the POSIX module.)  The
  20.      ppppllll2222ppppmmmm file in the distribution may help in your conversion, but it's just
  21.      a mechanical process and therefore far from bulletproof.
  22.  
  23.      PPPPrrrraaaaggggmmmmaaaattttiiiicccc MMMMoooodddduuuulllleeeessss
  24.  
  25.      They work somewhat like pragmas in that they tend to affect the
  26.      compilation of your program, and thus will usually work well only when
  27.      used within a use, or no.  Most of these are locally scoped, so an inner
  28.      BLOCK may countermand any of these by saying:
  29.  
  30.          no integer;
  31.          no strict 'refs';
  32.  
  33.      which lasts until the end of that BLOCK.
  34.  
  35.      Unlike the pragmas that effect the $^H hints variable, the use vars and
  36.      use subs declarations are not BLOCK-scoped.  They allow you to predeclare
  37.      a variables or subroutines within a particular _f_i_l_e rather than just a
  38.      block.  Such declarations are effective for the entire file for which
  39.      they were declared.  You cannot rescind them with no vars or no subs.
  40.  
  41.      The following pragmas are defined (and have their own documentation).
  42.  
  43.      use autouse MODULE => qw(sub1 sub2 sub3)
  44.                  Defers require MODULE until someone calls one of the
  45.                  specified subroutines (which must be exported by MODULE).
  46.                  This pragma should be used with caution, and only when
  47.                  necessary.
  48.  
  49.      blib        manipulate @INC at compile time to use MakeMaker's
  50.                  uninstalled version of a package
  51.  
  52.      diagnostics force verbose warning diagnostics
  53.  
  54.      integer     compute arithmetic in integer instead of double
  55.  
  56.      less        request less of something from the compiler
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  71.  
  72.  
  73.  
  74.      lib         manipulate @INC at compile time
  75.  
  76.      locale      use or ignore current locale for builtin operations (see the
  77.                  _p_e_r_l_l_o_c_a_l_e manpage)
  78.  
  79.      ops         restrict named opcodes when compiling or running Perl code
  80.  
  81.      overload    overload basic Perl operations
  82.  
  83.      sigtrap     enable simple signal handling
  84.  
  85.      strict      restrict unsafe constructs
  86.  
  87.      subs        predeclare sub names
  88.  
  89.      vmsish      adopt certain VMS-specific behaviors
  90.  
  91.      vars        predeclare global variable names
  92.  
  93.      SSSSttttaaaannnnddddaaaarrrrdddd MMMMoooodddduuuulllleeeessss
  94.  
  95.      Standard, bundled modules are all expected to behave in a well-defined
  96.      manner with respect to namespace pollution because they use the Exporter
  97.      module.  See their own documentation for details.
  98.  
  99.      AnyDBM_File provide framework for multiple DBMs
  100.  
  101.      AutoLoader  load functions only on demand
  102.  
  103.      AutoSplit   split a package for autoloading
  104.  
  105.      Benchmark   benchmark running times of code
  106.  
  107.      CPAN        interface to Comprehensive Perl Archive Network
  108.  
  109.      CPAN::FirstTime
  110.                  create a CPAN configuration file
  111.  
  112.      CPAN::Nox   run CPAN while avoiding compiled extensions
  113.  
  114.      Carp        warn of errors (from perspective of caller)
  115.  
  116.      Class::Struct
  117.                  declare struct-like datatypes
  118.  
  119.      Config      access Perl configuration information
  120.  
  121.      Cwd         get pathname of current working directory
  122.  
  123.      DB_File     access to Berkeley DB
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  137.  
  138.  
  139.  
  140.      Devel::SelfStubber
  141.                  generate stubs for a SelfLoading module
  142.  
  143.      DirHandle   supply object methods for directory handles
  144.  
  145.      DynaLoader  dynamically load C libraries into Perl code
  146.  
  147.      English     use nice English (or awk) names for ugly punctuation
  148.                  variables
  149.  
  150.      Env         import environment variables
  151.  
  152.      Exporter    implements default import method for modules
  153.  
  154.      ExtUtils::Embed
  155.                  utilities for embedding Perl in C/C++ applications
  156.  
  157.      ExtUtils::Install
  158.                  install files from here to there
  159.  
  160.      ExtUtils::Liblist
  161.                  determine libraries to use and how to use them
  162.  
  163.      ExtUtils::MM_OS2
  164.                  methods to override Unix behaviour in ExtUtils::MakeMaker
  165.  
  166.      ExtUtils::MM_Unix
  167.                  methods used by ExtUtils::MakeMaker
  168.  
  169.      ExtUtils::MM_VMS
  170.                  methods to override Unix behaviour in ExtUtils::MakeMaker
  171.  
  172.      ExtUtils::MakeMaker
  173.                  create an extension Makefile
  174.  
  175.      ExtUtils::Manifest
  176.                  utilities to write and check a MANIFEST file
  177.  
  178.      ExtUtils::Mkbootstrap
  179.                  make a bootstrap file for use by DynaLoader
  180.  
  181.      ExtUtils::Mksymlists
  182.                  write linker options files for dynamic extension
  183.  
  184.      ExtUtils::testlib
  185.                  add blib/* directories to @INC
  186.  
  187.      Fcntl       load the C Fcntl.h defines
  188.  
  189.      File::Basename
  190.                  split a pathname into pieces
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  203.  
  204.  
  205.  
  206.      File::CheckTree
  207.                  run many filetest checks on a tree
  208.  
  209.      File::Compare
  210.                  compare files or filehandles
  211.  
  212.      File::Copy  copy files or filehandles
  213.  
  214.      File::Find  traverse a file tree
  215.  
  216.      File::Path  create or remove a series of directories
  217.  
  218.      File::stat  by-name interface to Perl's builtin _s_t_a_t() functions
  219.  
  220.      FileCache   keep more files open than the system permits
  221.  
  222.      FileHandle  supply object methods for filehandles
  223.  
  224.      FindBin     locate directory of original perl script
  225.  
  226.      GDBM_File   access to the gdbm library
  227.  
  228.      Getopt::Long
  229.                  extended processing of command line options
  230.  
  231.      Getopt::Std process single-character switches with switch clustering
  232.  
  233.      I18N::Collate
  234.                  compare 8-bit scalar data according to the current locale
  235.  
  236.      IO          load various IO modules
  237.  
  238.      IO::File    supply object methods for filehandles
  239.  
  240.      IO::Handle  supply object methods for I/O handles
  241.  
  242.      IO::Pipe    supply object methods for pipes
  243.  
  244.      IO::Seekable
  245.                  supply seek based methods for I/O objects
  246.  
  247.      IO::Select  OO interface to the select system call
  248.  
  249.      IO::Socket  object interface to socket communications
  250.  
  251.      IPC::Open2  open a process for both reading and writing
  252.  
  253.      IPC::Open3  open a process for reading, writing, and error handling
  254.  
  255.      Math::BigFloat
  256.                  arbitrary length float math package
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  269.  
  270.  
  271.  
  272.      Math::BigInt
  273.                  arbitrary size integer math package
  274.  
  275.      Math::Complex
  276.                  complex numbers and associated mathematical functions
  277.  
  278.      Math::Trig  simple interface to parts of Math::Complex for those who need
  279.                  trigonometric functions only for real numbers
  280.  
  281.      NDBM_File   tied access to ndbm files
  282.  
  283.      Net::Ping   Hello, anybody home?
  284.  
  285.      Net::hostent
  286.                  by-name interface to Perl's builtin gethost*() functions
  287.  
  288.      Net::netent by-name interface to Perl's builtin getnet*() functions
  289.  
  290.      Net::protoent
  291.                  by-name interface to Perl's builtin getproto*() functions
  292.  
  293.      Net::servent
  294.                  by-name interface to Perl's builtin getserv*() functions
  295.  
  296.      Opcode      disable named opcodes when compiling or running perl code
  297.  
  298.      Pod::Text   convert POD data to formatted ASCII text
  299.  
  300.      POSIX       interface to IEEE Standard 1003.1
  301.  
  302.      SDBM_File   tied access to sdbm files
  303.  
  304.      Safe        compile and execute code in restricted compartments
  305.  
  306.      Search::Dict
  307.                  search for key in dictionary file
  308.  
  309.      SelectSaver save and restore selected file handle
  310.  
  311.      SelfLoader  load functions only on demand
  312.  
  313.      Shell       run shell commands transparently within perl
  314.  
  315.      Socket      load the C socket.h defines and structure manipulators
  316.  
  317.      Symbol      manipulate Perl symbols and their names
  318.  
  319.      Sys::Hostname
  320.                  try every conceivable way to get hostname
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  335.  
  336.  
  337.  
  338.      Sys::Syslog interface to the Unix _s_y_s_l_o_g(3) calls
  339.  
  340.      Term::Cap   termcap interface
  341.  
  342.      Term::Complete
  343.                  word completion module
  344.  
  345.      Term::ReadLine
  346.                  interface to various readline packages
  347.  
  348.      Test::Harness
  349.                  run perl standard test scripts with statistics
  350.  
  351.      Text::Abbrev
  352.                  create an abbreviation table from a list
  353.  
  354.      Text::ParseWords
  355.                  parse text into an array of tokens
  356.  
  357.      Text::Soundex
  358.                  implementation of the Soundex Algorithm as described by Knuth
  359.  
  360.      Text::Tabs  expand and unexpand tabs per the Unix _e_x_p_a_n_d(1) and
  361.                  _u_n_e_x_p_a_n_d(1)
  362.  
  363.      Text::Wrap  line wrapping to form simple paragraphs
  364.  
  365.      Tie::Hash   base class definitions for tied hashes
  366.  
  367.      Tie::RefHash
  368.                  base class definitions for tied hashes with references as
  369.                  keys
  370.  
  371.      Tie::Scalar base class definitions for tied scalars
  372.  
  373.      Tie::SubstrHash
  374.                  fixed-table-size, fixed-key-length hashing
  375.  
  376.      Time::Local efficiently compute time from local and GMT time
  377.  
  378.      Time::gmtime
  379.                  by-name interface to Perl's builtin _g_m_t_i_m_e() function
  380.  
  381.      Time::localtime
  382.                  by-name interface to Perl's builtin _l_o_c_a_l_t_i_m_e() function
  383.  
  384.      Time::tm    internal object used by Time::gmtime and Time::localtime
  385.  
  386.      UNIVERSAL   base class for ALL classes (blessed references)
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  401.  
  402.  
  403.  
  404.      User::grent by-name interface to Perl's builtin getgr*() functions
  405.  
  406.      User::pwent by-name interface to Perl's builtin getpw*() functions
  407.  
  408.      To find out _a_l_l the modules installed on your system, including those
  409.      without documentation or outside the standard release, do this:
  410.  
  411.          find `perl -e 'print "@INC"'` -name '*.pm' -print
  412.  
  413.      They should all have their own documentation installed and accessible via
  414.      your system _m_a_n(1) command.  If that fails, try the _p_e_r_l_d_o_c program.
  415.  
  416.      EEEExxxxtttteeeennnnssssiiiioooonnnn MMMMoooodddduuuulllleeeessss
  417.  
  418.      Extension modules are written in C (or a mix of Perl and C) and may be
  419.      statically linked or in general are dynamically loaded into Perl if and
  420.      when you need them.  Supported extension modules include the Socket,
  421.      Fcntl, and POSIX modules.
  422.  
  423.      Many popular C extension modules do not come bundled (at least, not
  424.      completely) due to their sizes, volatility, or simply lack of time for
  425.      adequate testing and configuration across the multitude of platforms on
  426.      which Perl was beta-tested.  You are encouraged to look for them in
  427.      _a_r_c_h_i_e(1L), the Perl FAQ or Meta-FAQ, the WWW page, and even with their
  428.      authors before randomly posting asking for their present condition and
  429.      disposition.
  430.  
  431. CCCCPPPPAAAANNNN
  432.      CPAN stands for the Comprehensive Perl Archive Network.  This is a
  433.      globally replicated collection of all known Perl materials, including
  434.      hundreds of unbundled modules.  Here are the major categories of modules:
  435.  
  436.      +o Language Extensions and Documentation Tools
  437.  
  438.      +o Development Support
  439.  
  440.      +o Operating System Interfaces
  441.  
  442.      +o Networking, Device Control (modems) and InterProcess Communication
  443.  
  444.      +o Data Types and Data Type Utilities
  445.  
  446.      +o Database Interfaces
  447.  
  448.      +o User Interfaces
  449.  
  450.      +o Interfaces to / Emulations of Other Programming Languages
  451.  
  452.      +o File Names, File Systems and File Locking (see also File Handles)
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  467.  
  468.  
  469.  
  470.      +o String Processing, Language Text Processing, Parsing, and Searching
  471.  
  472.      +o Option, Argument, Parameter, and Configuration File Processing
  473.  
  474.      +o Internationalization and Locale
  475.  
  476.      +o Authentication, Security, and Encryption
  477.  
  478.      +o World Wide Web, HTML, HTTP, CGI, MIME
  479.  
  480.      +o Server and Daemon Utilities
  481.  
  482.      +o Archiving and Compression
  483.  
  484.      +o Images, Pixmap and Bitmap Manipulation, Drawing, and Graphing
  485.  
  486.      +o Mail and Usenet News
  487.  
  488.      +o Control Flow Utilities (callbacks and exceptions etc)
  489.  
  490.      +o File Handle and Input/Output Stream Utilities
  491.  
  492.      +o Miscellaneous Modules
  493.  
  494.      The registered CPAN sites as of this writing include the following.  You
  495.      should try to choose one close to you:
  496.  
  497.      +o Africa
  498.  
  499.               South Africa    ftp://ftp.is.co.za/programming/perl/CPAN/
  500.  
  501.  
  502.      +o Asia
  503.  
  504.               Hong Kong       ftp://ftp.hkstar.com/pub/CPAN/
  505.               Japan           ftp://ftp.jaist.ac.jp/pub/lang/perl/CPAN/
  506.                               ftp://ftp.lab.kdd.co.jp/lang/perl/CPAN/
  507.               South Korea     ftp://ftp.nuri.net/pub/CPAN/
  508.               Taiwan          ftp://dongpo.math.ncu.edu.tw/perl/CPAN/
  509.                               ftp://ftp.wownet.net/pub2/PERL/
  510.  
  511.  
  512.      +o Australasia
  513.  
  514.               Australia       ftp://ftp.netinfo.com.au/pub/perl/CPAN/
  515.               New Zealand     ftp://ftp.tekotago.ac.nz/pub/perl/CPAN/
  516.  
  517.  
  518.      +o Europe
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  533.  
  534.  
  535.  
  536.               Austria         ftp://ftp.tuwien.ac.at/pub/languages/perl/CPAN/
  537.               Belgium         ftp://ftp.kulnet.kuleuven.ac.be/pub/mirror/CPAN/
  538.               Czech Republic  ftp://sunsite.mff.cuni.cz/Languages/Perl/CPAN/
  539.               Denmark         ftp://sunsite.auc.dk/pub/languages/perl/CPAN/
  540.               Finland         ftp://ftp.funet.fi/pub/languages/perl/CPAN/
  541.               France          ftp://ftp.ibp.fr/pub/perl/CPAN/
  542.                               ftp://ftp.pasteur.fr/pub/computing/unix/perl/CPAN/
  543.               Germany         ftp://ftp.gmd.de/packages/CPAN/
  544.                               ftp://ftp.leo.org/pub/comp/programming/languages/perl/CPAN/
  545.                               ftp://ftp.mpi-sb.mpg.de/pub/perl/CPAN/
  546.                               ftp://ftp.rz.ruhr-uni-bochum.de/pub/CPAN/
  547.                               ftp://ftp.uni-erlangen.de/pub/source/Perl/CPAN/
  548.                               ftp://ftp.uni-hamburg.de/pub/soft/lang/perl/CPAN/
  549.               Greece          ftp://ftp.ntua.gr/pub/lang/perl/
  550.               Hungary         ftp://ftp.kfki.hu/pub/packages/perl/CPAN/
  551.               Italy           ftp://cis.utovrm.it/CPAN/
  552.               the Netherlands ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
  553.                               ftp://ftp.EU.net/packages/cpan/
  554.               Norway          ftp://ftp.uit.no/pub/languages/perl/cpan/
  555.               Poland          ftp://ftp.pk.edu.pl/pub/lang/perl/CPAN/
  556.                               ftp://sunsite.icm.edu.pl/pub/CPAN/
  557.               Portugal        ftp://ftp.ci.uminho.pt/pub/lang/perl/
  558.                               ftp://ftp.telepac.pt/pub/CPAN/
  559.               Russia          ftp://ftp.sai.msu.su/pub/lang/perl/CPAN/
  560.               Slovenia        ftp://ftp.arnes.si/software/perl/CPAN/
  561.               Spain           ftp://ftp.etse.urv.es/pub/mirror/perl/
  562.                               ftp://ftp.rediris.es/mirror/CPAN/
  563.               Sweden          ftp://ftp.sunet.se/pub/lang/perl/CPAN/
  564.               UK              ftp://ftp.demon.co.uk/pub/mirrors/perl/CPAN/
  565.                               ftp://sunsite.doc.ic.ac.uk/packages/CPAN/
  566.                               ftp://unix.hensa.ac.uk/mirrors/perl-CPAN/
  567.  
  568.  
  569.      +o North America
  570.  
  571.               Ontario         ftp://ftp.utilis.com/public/CPAN/
  572.                               ftp://enterprise.ic.gc.ca/pub/perl/CPAN/
  573.               Manitoba        ftp://theory.uwinnipeg.ca/pub/CPAN/
  574.               California      ftp://ftp.digital.com/pub/plan/perl/CPAN/
  575.                               ftp://ftp.cdrom.com/pub/perl/CPAN/
  576.               Colorado        ftp://ftp.cs.colorado.edu/pub/perl/CPAN/
  577.               Florida         ftp://ftp.cis.ufl.edu/pub/perl/CPAN/
  578.               Illinois        ftp://uiarchive.uiuc.edu/pub/lang/perl/CPAN/
  579.               Massachusetts   ftp://ftp.iguide.com/pub/mirrors/packages/perl/CPAN/
  580.               New York        ftp://ftp.rge.com/pub/languages/perl/
  581.               North Carolina  ftp://ftp.duke.edu/pub/perl/
  582.               Oklahoma        ftp://ftp.ou.edu/mirrors/CPAN/
  583.               Oregon          http://www.perl.org/CPAN/
  584.                               ftp://ftp.orst.edu/pub/packages/CPAN/
  585.               Pennsylvania    ftp://ftp.epix.net/pub/languages/perl/
  586.               Texas           ftp://ftp.sedl.org/pub/mirrors/CPAN/
  587.                               ftp://ftp.metronet.com/pub/perl/
  588.  
  589.  
  590.  
  591.                                                                         PPPPaaaaggggeeee 9999
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  599.  
  600.  
  601.  
  602.      +o South America
  603.  
  604.               Chile           ftp://sunsite.dcc.uchile.cl/pub/Lang/perl/CPAN/
  605.  
  606.  
  607.      For an up-to-date listing of CPAN sites, see
  608.      _h_t_t_p://_w_w_w._p_e_r_l._c_o_m/_p_e_r_l/_C_P_A_N or _f_t_p://_f_t_p._p_e_r_l._c_o_m/_p_e_r_l/.
  609.  
  610. MMMMoooodddduuuulllleeeessss:::: CCCCrrrreeeeaaaattttiiiioooonnnn,,,, UUUUsssseeee,,,, aaaannnndddd AAAAbbbbuuuusssseeee
  611.      (The following section is borrowed directly from Tim Bunce's modules
  612.      file, available at your nearest CPAN site.)
  613.  
  614.      Perl implements a class using a package, but the presence of a package
  615.      doesn't imply the presence of a class.  A package is just a namespace.  A
  616.      class is a package that provides subroutines that can be used as methods.
  617.      A method is just a subroutine that expects, as its first argument, either
  618.      the name of a package (for "static" methods), or a reference to something
  619.      (for "virtual" methods).
  620.  
  621.      A module is a file that (by convention) provides a class of the same name
  622.      (sans the .pm), plus an import method in that class that can be called to
  623.      fetch exported symbols.  This module may implement some of its methods by
  624.      loading dynamic C or C++ objects, but that should be totally transparent
  625.      to the user of the module.  Likewise, the module might set up an AUTOLOAD
  626.      function to slurp in subroutine definitions on demand, but this is also
  627.      transparent.  Only the ._p_m file is required to exist.  See the _p_e_r_l_s_u_b
  628.      manpage, the _p_e_r_l_t_o_o_t manpage, and the _A_u_t_o_L_o_a_d_e_r manpage for details
  629.      about the AUTOLOAD mechanism.
  630.  
  631.      GGGGuuuuiiiiddddeeeelllliiiinnnneeeessss ffffoooorrrr MMMMoooodddduuuulllleeee CCCCrrrreeeeaaaattttiiiioooonnnn
  632.  
  633.      Do similar modules already exist in some form?
  634.          If so, please try to reuse the existing modules either in whole or by
  635.          inheriting useful features into a new class.  If this is not
  636.          practical try to get together with the module authors to work on
  637.          extending or enhancing the functionality of the existing modules.  A
  638.          perfect example is the plethora of packages in perl4 for dealing with
  639.          command line options.
  640.  
  641.          If you are writing a module to expand an already existing set of
  642.          modules, please coordinate with the author of the package.  It helps
  643.          if you follow the same naming scheme and module interaction scheme as
  644.          the original author.
  645.  
  646.      Try to design the new module to be easy to extend and reuse.
  647.          Use blessed references.  Use the two argument form of bless to bless
  648.          into the class name given as the first parameter of the constructor,
  649.          e.g.,:
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.                                                                        PPPPaaaaggggeeee 11110000
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  665.  
  666.  
  667.  
  668.           sub new {
  669.                  my $class = shift;
  670.                  return bless {}, $class;
  671.           }
  672.  
  673.          or even this if you'd like it to be used as either a static or a
  674.          virtual method.
  675.  
  676.           sub new {
  677.                  my $self  = shift;
  678.                  my $class = ref($self) || $self;
  679.                  return bless {}, $class;
  680.           }
  681.  
  682.          Pass arrays as references so more parameters can be added later (it's
  683.          also faster).  Convert functions into methods where appropriate.
  684.          Split large methods into smaller more flexible ones.  Inherit methods
  685.          from other modules if appropriate.
  686.  
  687.          Avoid class name tests like: die "Invalid" unless ref $ref eq 'FOO'.
  688.          Generally you can delete the "eq 'FOO'" part with no harm at all.
  689.          Let the objects look after themselves! Generally, avoid hard-wired
  690.          class names as far as possible.
  691.  
  692.          Avoid $r->_C_l_a_s_s::_f_u_n_c() where using @ISA=qw(... Class ...) and $r-
  693.          >_f_u_n_c() would work (see the _p_e_r_l_b_o_t manpage for more details).
  694.  
  695.          Use autosplit so little used or newly added functions won't be a
  696.          burden to programs which don't use them. Add test functions to the
  697.          module after __END__ either using AutoSplit or by saying:
  698.  
  699.           eval join('',<main::DATA>) || die $@ unless caller();
  700.  
  701.          Does your module pass the 'empty subclass' test? If you say
  702.          "@SUBCLASS::ISA = qw(YOURCLASS);" your applications should be able to
  703.          use SUBCLASS in exactly the same way as YOURCLASS.  For example, does
  704.          your application still work if you change:  $obj = new YOURCLASS;
  705.          into: $obj = new SUBCLASS; ?
  706.  
  707.          Avoid keeping any state information in your packages. It makes it
  708.          difficult for multiple other packages to use yours. Keep state
  709.          information in objects.
  710.  
  711.          Always use ----wwww. Try to use strict; (or use strict qw(...);).  Remember
  712.          that you can add no strict qw(...); to individual blocks of code
  713.          which need less strictness. Always use ----wwww. Always use ----wwww!  Follow the
  714.          guidelines in the _p_e_r_l_s_t_y_l_e(1) manual.
  715.  
  716.      Some simple style guidelines
  717.          The perlstyle manual supplied with perl has many helpful points.
  718.  
  719.          Coding style is a matter of personal taste. Many people evolve their
  720.  
  721.  
  722.  
  723.                                                                        PPPPaaaaggggeeee 11111111
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  731.  
  732.  
  733.  
  734.          style over several years as they learn what helps them write and
  735.          maintain good code.  Here's one set of assorted suggestions that seem
  736.          to be widely used by experienced developers:
  737.  
  738.          Use underscores to separate words.  It is generally easier to read
  739.          $var_names_like_this than $VarNamesLikeThis, especially for non-
  740.          native speakers of English. It's also a simple rule that works
  741.          consistently with VAR_NAMES_LIKE_THIS.
  742.  
  743.          Package/Module names are an exception to this rule. Perl informally
  744.          reserves lowercase module names for 'pragma' modules like integer and
  745.          strict. Other modules normally begin with a capital letter and use
  746.          mixed case with no underscores (need to be short and portable).
  747.  
  748.          You may find it helpful to use letter case to indicate the scope or
  749.          nature of a variable. For example:
  750.  
  751.           $ALL_CAPS_HERE   constants only (beware clashes with perl vars)
  752.           $Some_Caps_Here  package-wide global/static
  753.           $no_caps_here    function scope my() or local() variables
  754.  
  755.          Function and method names seem to work best as all lowercase.  e.g.,
  756.          $obj->_a_s__s_t_r_i_n_g().
  757.  
  758.          You can use a leading underscore to indicate that a variable or
  759.          function should not be used outside the package that defined it.
  760.  
  761.      Select what to export.
  762.          Do NOT export method names!
  763.  
  764.          Do NOT export anything else by default without a good reason!
  765.  
  766.          Exports pollute the namespace of the module user.  If you must export
  767.          try to use @EXPORT_OK in preference to @EXPORT and avoid short or
  768.          common names to reduce the risk of name clashes.
  769.  
  770.          Generally anything not exported is still accessible from outside the
  771.          module using the ModuleName::item_name (or $blessed_ref->method)
  772.          syntax.  By convention you can use a leading underscore on names to
  773.          indicate informally that they are 'internal' and not for public use.
  774.  
  775.          (It is actually possible to get private functions by saying:  my
  776.          $subref = sub { ... };  &$subref;.  But there's no way to call that
  777.          directly as a method, because a method must have a name in the symbol
  778.          table.)
  779.  
  780.          As a general rule, if the module is trying to be object oriented then
  781.          export nothing. If it's just a collection of functions then
  782.          @EXPORT_OK anything but use @EXPORT with caution.
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.                                                                        PPPPaaaaggggeeee 11112222
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  797.  
  798.  
  799.  
  800.      Select a name for the module.
  801.          This name should be as descriptive, accurate, and complete as
  802.          possible.  Avoid any risk of ambiguity. Always try to use two or more
  803.          whole words.  Generally the name should reflect what is special about
  804.          what the module does rather than how it does it.  Please use nested
  805.          module names to group informally or categorize a module.  There
  806.          should be a very good reason for a module not to have a nested name.
  807.          Module names should begin with a capital letter.
  808.  
  809.          Having 57 modules all called Sort will not make life easy for anyone
  810.          (though having 23 called Sort::Quick is only marginally better :-).
  811.          Imagine someone trying to install your module alongside many others.
  812.          If in any doubt ask for suggestions in comp.lang.perl.misc.
  813.  
  814.          If you are developing a suite of related modules/classes it's good
  815.          practice to use nested classes with a common prefix as this will
  816.          avoid namespace clashes. For example: Xyz::Control, Xyz::View,
  817.          Xyz::Model etc. Use the modules in this list as a naming guide.
  818.  
  819.          If adding a new module to a set, follow the original author's
  820.          standards for naming modules and the interface to methods in those
  821.          modules.
  822.  
  823.          To be portable each component of a module name should be limited to
  824.          11 characters. If it might be used on MS-DOS then try to ensure each
  825.          is unique in the first 8 characters. Nested modules make this easier.
  826.  
  827.      Have you got it right?
  828.          How do you know that you've made the right decisions? Have you picked
  829.          an interface design that will cause problems later? Have you picked
  830.          the most appropriate name? Do you have any questions?
  831.  
  832.          The best way to know for sure, and pick up many helpful suggestions,
  833.          is to ask someone who knows. Comp.lang.perl.misc is read by just
  834.          about all the people who develop modules and it's the best place to
  835.          ask.
  836.  
  837.          All you need to do is post a short summary of the module, its purpose
  838.          and interfaces. A few lines on each of the main methods is probably
  839.          enough. (If you post the whole module it might be ignored by busy
  840.          people - generally the very people you want to read it!)
  841.  
  842.          Don't worry about posting if you can't say when the module will be
  843.          ready - just say so in the message. It might be worth inviting others
  844.          to help you, they may be able to complete it for you!
  845.  
  846.      README and other Additional Files.
  847.          It's well known that software developers usually fully document the
  848.          software they write. If, however, the world is in urgent need of your
  849.          software and there is not enough time to write the full documentation
  850.          please at least provide a README file containing:
  851.  
  852.  
  853.  
  854.  
  855.                                                                        PPPPaaaaggggeeee 11113333
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  863.  
  864.  
  865.  
  866.      +o A description of the module/package/extension etc.
  867.  
  868.      +o A copyright notice - see below.
  869.  
  870.      +o Prerequisites - what else you may need to have.
  871.  
  872.      +o How to build it - possible changes to Makefile.PL etc.
  873.  
  874.      +o How to install it.
  875.  
  876.      +o Recent changes in this release, especially incompatibilities
  877.  
  878.      +o Changes / enhancements you plan to make in the future.
  879.  
  880.                    If the README file seems to be getting too large you may
  881.                    wish to split out some of the sections into separate files:
  882.                    INSTALL, Copying, ToDo etc.
  883.  
  884.      Adding a Copyright Notice.
  885.              How you choose to license your work is a personal decision.  The
  886.              general mechanism is to assert your Copyright and then make a
  887.              declaration of how others may copy/use/modify your work.
  888.  
  889.              Perl, for example, is supplied with two types of licence: The GNU
  890.              GPL and The Artistic Licence (see the files README, Copying, and
  891.              Artistic).  Larry has good reasons for NOT just using the GNU
  892.              GPL.
  893.  
  894.              My personal recommendation, out of respect for Larry, Perl, and
  895.              the perl community at large is to state something simply like:
  896.  
  897.               Copyright (c) 1995 Your Name. All rights reserved.
  898.               This program is free software; you can redistribute it and/or
  899.               modify it under the same terms as Perl itself.
  900.  
  901.              This statement should at least appear in the README file. You may
  902.              also wish to include it in a Copying file and your source files.
  903.              Remember to include the other words in addition to the Copyright.
  904.  
  905.      Give the module a version/issue/release number.
  906.              To be fully compatible with the Exporter and MakeMaker modules
  907.              you should store your module's version number in a non-my package
  908.              variable called $VERSION.  This should be a floating point number
  909.              with at least two digits after the decimal (i.e., hundredths,
  910.              e.g, $VERSION = "0.01").  Don't use a "1.3.2" style version.  See
  911.              Exporter.pm in Perl5.001m or later for details.
  912.  
  913.              It may be handy to add a function or method to retrieve the
  914.              number.  Use the number in announcements and archive file names
  915.              when releasing the module (ModuleName-1.02.tar.Z).  See perldoc
  916.              ExtUtils::MakeMaker.pm for details.
  917.  
  918.  
  919.  
  920.  
  921.                                                                        PPPPaaaaggggeeee 11114444
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  929.  
  930.  
  931.  
  932.      How to release and distribute a module.
  933.              It's good idea to post an announcement of the availability of
  934.              your module (or the module itself if small) to the
  935.              comp.lang.perl.announce Usenet newsgroup.  This will at least
  936.              ensure very wide once-off distribution.
  937.  
  938.              If possible you should place the module into a major ftp archive
  939.              and include details of its location in your announcement.
  940.  
  941.              Some notes about ftp archives: Please use a long descriptive file
  942.              name which includes the version number. Most incoming directories
  943.              will not be readable/listable, i.e., you won't be able to see
  944.              your file after uploading it. Remember to send your email
  945.              notification message as soon as possible after uploading else
  946.              your file may get deleted automatically. Allow time for the file
  947.              to be processed and/or check the file has been processed before
  948.              announcing its location.
  949.  
  950.              FTP Archives for Perl Modules:
  951.  
  952.              Follow the instructions and links on
  953.  
  954.                 http://franz.ww.tu-berlin.de/modulelist
  955.  
  956.              or upload to one of these sites:
  957.  
  958.                 ftp://franz.ww.tu-berlin.de/incoming
  959.                 ftp://ftp.cis.ufl.edu/incoming
  960.  
  961.              and notify <_u_p_l_o_a_d@_f_r_a_n_z._w_w._t_u-_b_e_r_l_i_n._d_e>.
  962.  
  963.              By using the WWW interface you can ask the Upload Server to
  964.              mirror your modules from your ftp or WWW site into your own
  965.              directory on CPAN!
  966.  
  967.              Please remember to send me an updated entry for the Module list!
  968.  
  969.      Take care when changing a released module.
  970.              Always strive to remain compatible with previous released
  971.              versions (see 2.2 above) Otherwise try to add a mechanism to
  972.              revert to the old behaviour if people rely on it. Document
  973.              incompatible changes.
  974.  
  975.      GGGGuuuuiiiiddddeeeelllliiiinnnneeeessss ffffoooorrrr CCCCoooonnnnvvvveeeerrrrttttiiiinnnngggg PPPPeeeerrrrllll 4444 LLLLiiiibbbbrrrraaaarrrryyyy SSSSccccrrrriiiippppttttssss iiiinnnnttttoooo MMMMoooodddduuuulllleeeessss
  976.  
  977.      There is no requirement to convert anything.
  978.          If it ain't broke, don't fix it! Perl 4 library scripts should
  979.          continue to work with no problems. You may need to make some minor
  980.          changes (like escaping non-array @'s in double quoted strings) but
  981.          there is no need to convert a .pl file into a Module for just that.
  982.  
  983.  
  984.  
  985.  
  986.  
  987.                                                                        PPPPaaaaggggeeee 11115555
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  995.  
  996.  
  997.  
  998.      Consider the implications.
  999.          All the perl applications which make use of the script will need to
  1000.          be changed (slightly) if the script is converted into a module.  Is
  1001.          it worth it unless you plan to make other changes at the same time?
  1002.  
  1003.      Make the most of the opportunity.
  1004.          If you are going to convert the script to a module you can use the
  1005.          opportunity to redesign the interface. The 'Guidelines for Module
  1006.          Creation' above include many of the issues you should consider.
  1007.  
  1008.      The pl2pm utility will get you started.
  1009.          This utility will read *.pl files (given as parameters) and write
  1010.          corresponding *.pm files. The pl2pm utilities does the following:
  1011.  
  1012.      +o Adds the standard Module prologue lines
  1013.  
  1014.      +o Converts package specifiers from ' to ::
  1015.  
  1016.      +o Converts die(...) to croak(...)
  1017.  
  1018.      +o Several other minor changes
  1019.  
  1020.                    Being a mechanical process pl2pm is not bullet proof. The
  1021.                    converted code will need careful checking, especially any
  1022.                    package statements.  Don't delete the original .pl file
  1023.                    till the new .pm one works!
  1024.  
  1025.      GGGGuuuuiiiiddddeeeelllliiiinnnneeeessss ffffoooorrrr RRRReeeeuuuussssiiiinnnngggg AAAApppppppplllliiiiccccaaaattttiiiioooonnnn CCCCooooddddeeee
  1026.  
  1027.      Complete applications rarely belong in the Perl Module Library.
  1028.  
  1029.      Many applications contain some perl code which could be reused.
  1030.          Help save the world! Share your code in a form that makes it easy to
  1031.          reuse.
  1032.  
  1033.      Break-out the reusable code into one or more separate module files.
  1034.  
  1035.      Take the opportunity to reconsider and redesign the interfaces.
  1036.  
  1037.      In some cases the 'application' can then be reduced to a small
  1038.          fragment of code built on top of the reusable modules. In these cases
  1039.          the application could invoked as:
  1040.  
  1041.               perl -e 'use Module::Name; method(@ARGV)' ...
  1042.          or
  1043.               perl -mModule::Name ...    (in perl5.002 or higher)
  1044.  
  1045.  
  1046. NNNNOOOOTTTTEEEE
  1047.      Perl does not enforce private and public parts of its modules as you may
  1048.      have been used to in other languages like C++, Ada, or Modula-17.  Perl
  1049.      doesn't have an infatuation with enforced privacy.  It would prefer that
  1050.  
  1051.  
  1052.  
  1053.                                                                        PPPPaaaaggggeeee 11116666
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  1061.  
  1062.  
  1063.  
  1064.      you stayed out of its living room because you weren't invited, not
  1065.      because it has a shotgun.
  1066.  
  1067.      The module and its user have a contract, part of which is common law, and
  1068.      part of which is "written".  Part of the common law contract is that a
  1069.      module doesn't pollute any namespace it wasn't asked to.  The written
  1070.      contract for the module (A.K.A. documentation) may make other provisions.
  1071.      But then you know when you use RedefineTheWorld that you're redefining
  1072.      the world and willing to take the consequences.
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.                                                                        PPPPaaaaggggeeee 11117777
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))                                                    PPPPEEEERRRRLLLLMMMMOOOODDDDLLLLIIIIBBBB((((1111))))
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.                                                                        PPPPaaaaggggeeee 11118888
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.